<%@ page import="com.zgroup.domain.Picture" %>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="common_header"/>
  <g:set var="entityName" value="${message(code: 'picture.label', default: 'Picture')}"/>
  <title><g:message code="default.create.label" args="[entityName]"/></title>
</head>
<body>
<div class="nav">
  <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">首页</a></span>
  <span class="menuButton"><g:link class="list" action="list">图片列表</g:link></span>
</div>
<div class="body">
  <h1>创建图片：</h1>
  <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
  </g:if>
  <g:hasErrors bean="${pictureInstance}">
    <div class="errors">
      <g:renderErrors bean="${pictureInstance}" as="list"/>
    </div>
  </g:hasErrors>
  <g:form controller="picture" action="save" method="post" absolute= true enctype="multipart/form-data">
    <div class="dialog">
      <table>
        <tbody>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="fileName">文件：</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: pictureInstance, field: 'fileName', 'errors')}">

            <input type="file" name="file"/>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="info">信息：</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: pictureInstance, field: 'info', 'errors')}">

            <g:select name="info.id" from="${com.zgroup.domain.InfoRelease.list()}" optionKey="id" value="${bo?.id}" noSelection="['null': '']"/>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="okFlag">是否入库：</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: pictureInstance, field: 'okFlag', 'errors')}">
            <g:checkBox name="okFlag" value="${pictureInstance?.okFlag}"/>
          </td>
        </tr>

        <input type="hidden" name="type" value="${bo?.type}"/>
        </tbody>
      </table>
    </div>
    <div class="buttons">
      <span class="button"><g:submitButton name="create" class="save" value="创建"/></span>
    </div>
  </g:form>
</div>
</body>
</html>
